<%@ page pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='zhyyglhtxt'/></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
    <style>
        html {
            background: #fff;
        }

        .layui-form-item .layui-input-inline {
            width: 350px;
            line-height: 38px;
        }
    </style>
</head>

<body>
<div class="layui-container">

    <div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

        <div class="layui-form">

            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='ffbh'/>：</label>
                <div class="layui-input-inline">${card.cardNo}</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='gwkmc'/>：</label>
                <div class="layui-input-inline">${card.name}</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='mz'/>：</label>
                <div class="layui-input-inline">${card.faceValue}</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='sj2'/>：</label>
                <div class="layui-input-inline">${card.price}</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='gwksl'/>：</label>
                <div class="layui-input-inline">${card.number}</div>
            </div>


            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='sypl'/>：</label>
                <div class="layui-input-inline">
                    <c:forEach var="channel" varStatus="status" items="${card.channels}">${channel.goodsChannel.name}、</c:forEach>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='sydq'/>：</label>
                <div class="layui-input-inline">
                    <c:if test="${card.areaType == 1}"><fmt:message key='sydq1'/></c:if>
                    <c:if test="${card.areaType == 2}">
                        <c:forEach var="address" varStatus="status" items="${card.addresses}">${address.province}${address.city}${address.area}、</c:forEach>
                    </c:if>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='yxq'/>：</label>
                <div class="layui-input-inline">
                    <c:if test="${card.validType == 1}"><fmt:formatDate value="${card.validStartTime}" pattern="yyyy-MM-dd HH:mm"/> - <fmt:formatDate value="${card.validEndTime}" pattern="yyyy-MM-dd HH:mm"/></c:if>
                    <c:if test="${card.validType == 2}"><fmt:message key='gmh'/>${card.validDays}<fmt:message key='tnksy'/></c:if>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='sysj1'/>：</label>
                <div class="layui-input-inline">
                    <c:if test="${card.merchantType == 1}"><fmt:message key='sysj2'/></c:if>
                    <c:if test="${card.merchantType == 2}">
                        <table class="layui-table">
                            <thead>
                            <tr>
                                <th><fmt:message key='xh'/></th>
                                <th><fmt:message key='sjzh'/></th>
                                <th><fmt:message key='sjmc'/></th>
                                <th><fmt:message key='ztlx'/></th>
                            </tr>
                            </thead>
                            <c:forEach varStatus="status" var="merchant" items="${card.merchants}">
                                <tr>
                                    <td>${status.index + 1}</td>
                                    <td>${merchant.merchant.username}</td>
                                    <td>${merchant.merchant.nickname}</td>
                                    <td>
                                        <c:if test="${merchant.merchant.mainType == 1}"><fmt:message key='qy1'/></c:if>
                                        <c:if test="${merchant.merchant.mainType == 2}"><fmt:message key='gth'/></c:if>
                                        <c:if test="${merchant.merchant.mainType == 3}"><fmt:message key='gr'/></c:if>
                                    </td>
                                </tr>
                            </c:forEach>
                        </table>
                    </c:if>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='sysp'/>：</label>
                <div class="layui-input-inline">
                    <c:if test="${card.goodsType == 1}"><fmt:message key='sysp1'/></c:if>
                    <c:if test="${card.goodsType == 2}">
                        <table class="layui-table">
                            <thead>
                                <tr>
                                    <th><fmt:message key='xh'/></th>
                                    <th><fmt:message key='spmc'/></th>
                                    <th><fmt:message key='sptp'/></th>
                                    <th><fmt:message key='spfl'/></th>
                                </tr>
                            </thead>
                            <c:forEach varStatus="status" var="goods" items="${card.goods}">
                                <tr>
                                    <td>${status.index + 1}</td>
                                    <td>${goods.goods.name}</td>
                                    <td><img src="${store_domain}/uploads/${goods.goods.defaultImage}" class="preview"></td>
                                    <td>${goods.goods.goodsChannel.parent.parent.name} - ${goods.goods.goodsChannel.parent.name} - ${goods.goods.goodsChannel.name}</td>
                                </tr>
                            </c:forEach>
                        </table>
                    </c:if>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"> <fmt:message key='zt'/>：</label>
                <div class="layui-input-inline">
                    <c:if test="${card.status == 1}"><fmt:message key='xj'/></c:if>
                    <c:if test="${card.status == 2}"><fmt:message key='sj'/></c:if>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    layui.use(['form']);
</script>
</body>
</fmt:bundle>
</html>